From 807526211991a2150bab5bdc562241e8e5ef9e8f Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sun, 9 Jan 2011 12:48:30 +0000 Subject: [PATCH] Avoid dot bloat in paths --- includes/resourceloader/ResourceLoaderFileModule.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index e1b3159708..e17a848264 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -493,8 +493,13 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { if ( $flip ) { $style = CSSJanus::transform( $style, true, false ); } - $dir = $this->getLocalPath( dirname( $path ) ); - $remoteDir = $this->getRemotePath( dirname( $path ) ); + $dirname = dirname( $path ); + if ( $dirname == '.' ) { + // If $path doesn't have a directory component, don't prepend a dot + $dirname = ''; + } + $dir = $this->getLocalPath( $dirname ); + $remoteDir = $this->getRemotePath( $dirname ); // Get and register local file references $this->localFileRefs = array_merge( $this->localFileRefs, -- 2.20.1